package com.zys.el.search.controller;


import com.zys.el.core.po.ResponseBean;
import com.zys.el.search.service.AnticleService;
import com.zys.el.user.po.Note;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping(value = "/anticle")
public class AnticleController {

    @Autowired
    private AnticleService anticleService;

    @DeleteMapping("/delete/{id}")
    public ResponseEntity deleteNoteById(@PathVariable Long id) {
        boolean b = anticleService.deleteById(id);
        return new ResponseEntity(HttpStatus.OK);
    }

    @PostMapping("/add")
    public ResponseEntity addNote(@RequestBody Note note) {
        boolean b = anticleService.addAnticle(note);
        return new ResponseEntity(HttpStatus.OK);
    }

}
